package Java学习.面向对象.静态方法;

public class Student {
    //写一个javabean类来描述学生
    private String name;
    private int age;
    private String gender;
    static String teacherName;          //加上以后表示所有的student对象都共享同一个老师姓名
    public Student(){};

    public Student(String name, int age, String gender) {
        this.name = name;
        this.age = age;
        this.gender = gender;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    //方法学习
    public void study(){
        System.out.println(name+"学习");
    }
    public void show(){
        System.out.println(name+","+age+","+gender+","+teacherName);
    }
}
